import message from './utils/message'

// app.js
App({
  onLaunch( options ) {

  
    //console.log("场景参数")
    //console.log(options)

    //message.show_error(str);
    // 展示本地存储能力
    const logs = wx.getStorageSync('logs') || []
    logs.unshift(Date.now())
    wx.setStorageSync('logs', logs)

    // 登录
    wx.login({
      success: res => {
        // 发送 res.code 到后台换取 openId, sessionKey, unionId
      }
    })

    var token = wx.getStorageSync('token');
    if(token){
      console.log(token)
    }
  },
  globalData: {
    userInfo: null,
    //static_url:"https://www.hujingx.com/web"
    static_url:"http://192.168.1.5:8999/web"
  },

  api_root:"",  
  onShow(options){
    //当小程序启动或者由后台进入前台显示时候会触发


    //加载分享码

    /*
    if(options.shareTicket){
      wx.getShareInfo({
        shareTicket: options.shareTicket,
        success:function( res ){
          message.action_success("" , JSON.stringify(res) , "确定" , function(){})

        }
      })

    }

    */

  },
  serApiRoot(){
    let App = this;
    App.api_root = `${siteInfo.siteroot}index.php?s=/api/`;
    
  },
  getWxappBase( callback ){
    let App = this;
  },


})
